package com.api.syh56.shengyunhui.config;

import cn.jiguang.sdk.api.DeviceApi;
import cn.jiguang.sdk.api.PushApi;
import com.api.syh56.shengyunhui.properties.JPushProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JpushConfig {

    @Autowired
    private JPushProperties jPushProperties;
    @Bean
    public PushApi getpushApi() {
        PushApi pushApi = new PushApi.Builder()
                .setAppKey(jPushProperties.getAppKey())
                .setMasterSecret(jPushProperties.getMasterSecret()).build();
        return pushApi;
    }

    @Bean
    public DeviceApi getdeviceApi() {
        DeviceApi deviceApi = new DeviceApi.Builder()
                .setAppKey(jPushProperties.getAppKey())
                .setMasterSecret(jPushProperties.getMasterSecret()).build();

        return deviceApi;
    }
}
